//
//  MVPDataSource.h
//  Demo_MVP
//
//  Created by 陈冰 on 2020/3/8.
//  Copyright © 2020 ChenBing. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^CellConfigBeforeBlock)(id cell, id model, NSIndexPath *indexPath);
typedef void (^SelectCellBlock) (NSIndexPath *indexPath);
typedef void (^ReloadDataBlock) (NSMutableArray *array);


/// 对tableView的代理做封装
@interface MVPDataSource : NSObject <UITableViewDataSource, UICollectionViewDataSource, UITableViewDelegate, UICollectionViewDelegate>

@property (nonatomic, strong) NSMutableArray *dataArray;
- (void)addDataToArray:(NSArray *)aDatas;

- (instancetype)initWithCellResueIdentifier:(NSString *)cellRI
                      cellConfigBeforeBlock:(CellConfigBeforeBlock)aCellConfigBeforeBlock
                            selectCellBlock:(SelectCellBlock)aSelectCellBlock
                            reloadDataBlock:(ReloadDataBlock)aReloadDataBlock;

@end

NS_ASSUME_NONNULL_END
